<template>
  <div class="my-form">
    <el-form :inline="true" :model="formInline">
      <el-form-item label="英雄名称：">
        <el-input v-model="formInline.name" placeholder="请输入英雄名称" />
      </el-form-item>
      <el-form-item label="英雄称号：">
        <el-input v-model="formInline.title" placeholder="请输入英雄称号" />
      </el-form-item>
      <el-form-item label="定位：">
        <el-input v-model="formInline.orientation" placeholder="请输入定位" />
      </el-form-item>
    </el-form>
    <div class="submit">
      <el-button type="primary" @click="onSubmit">查询</el-button>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref } from "vue";

const formInline = reactive({
  name: "",
  title: "",
  orientation: "",
});

const emit = defineEmits(["formSubmit"]);

const onSubmit = () => {
  emit("formSubmit", {
    name: formInline.name,
    title: formInline.title,
    orientation: formInline.orientation,
  });
};
</script>

<style lang="scss">
.my-form {
  .submit {
    display: flex;
    justify-content: end;
    padding-right: 30px;
  }
}
</style>
